package com.semp.jadoma.web.bean;

import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;

import com.semp.jadoma.core.model.DogReference;
import com.semp.jadoma.core.model.Family;

public class FamilyBean {

	private long id;
	private DogRefBean father;
	private DogRefBean mother;
	private Date birthDay;
	private ArrayList<DogRefBean> childs;

	public FamilyBean(Family family) {
		this.id = family.getId();
		this.father = new DogRefBean(family.getFather());
		this.mother = new DogRefBean(family.getMother());
		this.birthDay = family.getBirthDay();
		this.childs = new ArrayList<DogRefBean>();
		Iterator<DogReference> childRefIterator = family.getDogs().iterator();
		while (childRefIterator.hasNext()) {
			this.childs.add(new DogRefBean(childRefIterator.next()));
		}
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	public ArrayList<DogRefBean> getChilds() {
		return childs;
	}

	public void setChilds(ArrayList<DogRefBean> childs) {
		this.childs = childs;
	}

	public DogRefBean getFather() {
		return father;
	}

	public void setFather(DogRefBean father) {
		this.father = father;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public DogRefBean getMother() {
		return mother;
	}

	public void setMother(DogRefBean mother) {
		this.mother = mother;
	}

}
